home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
LIBRARY
/
PAS_0693
/
TBUTIL.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-06-30
|
2KB
|
63 lines
{─ Fido Pascal Conference ────────────────────────────────────────────── PASCAL ─
Msg : 42 of 92
From : Bryce Ostenson 1:282/4028.0 13 Jun 93 15:28
To : Bradley Wayth
Subj : Disabling The Ctrl-Alt-D
────────────────────────────────────────────────────────────────────────────────
BW> I am looking for a way to diable the use of the
BW> control break and control
BW> alt delete features. Would anyone have some code to do
BW> this in QuickPascal.}
UNIT TBUtil; { Tool box of nifty utilities}
INTERFACE
Uses
Dos;
Var
SavedInt23 : Pointer;
CBreak : Boolean;
Procedure SetCtrlBreak(Status : Boolean);
Function GetCtrlBreak : Boolean;
{I cut out a couple procedures and functions}
IMPLMENTATION
Procedure CBreakHandler; INTERRUPT; Begin End;
Procedure SetCtrlBreak(Status : Boolean);
Begin
If Status then
SetIntVec($23, SavedInt23);
Else
SetIntVec($23, @CBreakHandler);
CBreak := Status;
End;
Function GetCtrlBreak : Boolean;
Begin
GetCtrlBreak := CBreak;
End;
Begin { Unit Initalization }
CBreak := True;
GetIntVec($23,SavedInt23); { Save the Ctrl-Break handler. }
End.
There you go, although the same idea cannot be applied to int 19h (the
reboot interrupt). At least when I tried, it didn't work...
BTW: Simple concept... Here's how it works - When the program begins,
SavedInt23 is assigned to the original C-Break interrupt... When the
SetCtrlBreak procedure is called with Status equaling false, the C-Break
interrupt is assigned to a CBreakHandler which has no substance... Thus
when C-Break is called it does nothing. When SetCtrlBreak is called
with Status equaling false, Interrupt 23h is assigned to the default
C-Break handler. Sorry, this wasn't a good synopsis, but it works.